package com.demo.operation;

import java.time.LocalDate;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;

public class Main {
    public static void main(String[] args) {
        LocalDate date1 = LocalDate.of(2017, 12, 29);
        System.out.println(date1);

        LocalDate date2 = date1.withYear(2015);
        System.out.println(date2);

        LocalDate date3 = date2.withDayOfMonth(25);
        System.out.println(date3);

        LocalDate date4 = date3.with(ChronoField.MONTH_OF_YEAR, 9);
        System.out.println(date4);

        LocalDate date5 = date1.plusWeeks(1);
        System.out.println(date5);

        LocalDate date6 = date5.minusYears(3);
        System.out.println(date6);

        LocalDate date7 = date6.plus(6, ChronoUnit.MONTHS);
        System.out.println(date7);
    }
}
